#!/usr/bin/perl -w

use Test::More tests => 4;
use File::Temp;

# =============================================================
# Cargamos el modulo
# ==============================================================
use_ok('Bench::Test::Remote');

# =============================================================
# Comprobamos que la creacion del objeto es correcta
# =============================================================
SKIP: {
   my $host = $ENV{BENCH_TEST_REMOTE_HOST}
      or skip('because you must set enviroment var BENCH_TEST_REMOTE_HOST', 3);

   my $tempdir = File::Temp::tempdir( CLEANUP => 1 );

   no warnings 'once';
   $Bench::Test::Remote::GET_RESULT  = sub { return 'get_result' };
   $Bench::Test::Remote::SAVE_RESULT = sub { return 'save_result' };

   my $remote = Bench::Test::Remote->new (
      HOST       => $ENV{BENCH_TEST_REMOTE_HOST},
      WORKDIR    => '.',
      EXECUTABLE => 'echo',
   );

   isa_ok($remote, 'Bench::Test::Remote');

   is ($remote->get_result,  'get_result',  'Overwritting class scope get_result');
   is ($remote->save_result, 'save_result', 'Overwritting class scope save_result');
}
